package com.web44.mybatisplus.bean;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Title: User
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/3/5 9:22
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
// @TableName("t_user")  // 将实体映射表名
public class User {
    /**
     * value 字段和实体的映射
     * type 主键生成策略
     */
    @TableId(value = "uid")   // 设置id的映射
    // @TableId(value = "uid",type = IdType.ASSIGN_UUID)
    private Long id;
    @TableField("name")  // 实体映射字段
    private String username;
    private Integer age;
    private String email;

   // @TableLogic(value = "0",delval = "1")  // 注解局部设置
    // @TableLogic
    private Integer isDelete;

    public User(String name, Integer age, String email) {
        this.username = name;
        this.age = age;
        this.email = email;
    }

    public User(Long id, String username, Integer age, String email) {
        this.id = id;
        this.username = username;
        this.age = age;
        this.email = email;
    }
}
